using System;
using System.Text;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ELE.Common.Util;

namespace ELE.Common.Test
{
  /// <summary>
  /// Summary description for UtilTestFixture
  /// </summary>
  [TestClass]
  public class UtilTestFixture
  {
    public UtilTestFixture()
    {
      //
      // TODO: Add constructor logic here
      //
    }

    #region Additional test attributes
    //
    // You can use the following additional attributes as you write your tests:
    //
    // Use ClassInitialize to run code before running the first test in the class
    // [ClassInitialize()]
    // public static void MyClassInitialize(TestContext testContext) { }
    //
    // Use ClassCleanup to run code after all tests in a class have run
    // [ClassCleanup()]
    // public static void MyClassCleanup() { }
    //
    // Use TestInitialize to run code before running each test 
    // [TestInitialize()]
    // public void MyTestInitialize() { }
    //
    // Use TestCleanup to run code after each test has run
    // [TestCleanup()]
    // public void MyTestCleanup() { }
    //
    #endregion

    [TestMethod]
    public void TestObjectFactory()
    {
      object o = ObjectFactory.CreateGenericList("System.Int32");
      Console.WriteLine(o.ToString());
    }

    [TestMethod]
    public void TestStringUtils()
    {
      string original = "ascarASplaneas";
      string toReplace = "as";
      string replace = "-fast-";
      string result = StringUtils.ReplaceIgnoreCase(original, toReplace, replace);
      Console.WriteLine("Replaced string '{0}' in '{1}' to '{2}' and the result is '{3}'", toReplace, original, replace, result);
    }
  }
}
